﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;

public partial class Manage_User_Profile : System.Web.UI.Page
{
    protected int AccountID = PageRequest.GetInt("id", -1);
    public string Act = ManageHelper.PageAct();
    private KeRui.BLL.Admin bllAdmin;
    protected KeRui.Model.Admin modelAdmin;
    private int loginUserID = -1;
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();
        bllAdmin = new KeRui.BLL.Admin();
        loginUserID = KeRui.BLL.Account.GetLoginUserID();
        modelAdmin = bllAdmin.GetModel(loginUserID);
        if (modelAdmin == null)
        {
            Response.Write("Error！");
        }
        if (Act.ToLower() == "editsave")
        {
            AdminEditSave();
        }
    }
    private void AdminEditSave()
    {
        KeRui.Model.Admin ModelAdmin = new KeRui.Model.Admin();
        ModelAdmin.UserID = loginUserID;
        ModelAdmin.Username = PageRequest.GetString("Username");
        ModelAdmin.RealName = PageRequest.GetString("RealName");
        ModelAdmin.JobTitle = PageRequest.GetString("JobTitle");
        ModelAdmin.JobDept = PageRequest.GetString("JobDept");
        ModelAdmin.QQ = PageRequest.GetString("QQ");
        ModelAdmin.MSN = PageRequest.GetString("MSN");
        ModelAdmin.Email = PageRequest.GetString("Email");
        ModelAdmin.Mobile = PageRequest.GetString("Mobile");
        ModelAdmin.HomeTel = PageRequest.GetString("HomeTel");
        ModelAdmin.OfficeTel = PageRequest.GetString("OfficeTel");
        modelAdmin.State = 1;
        bllAdmin.UpdateAdminInfo(ModelAdmin);
        Response.Redirect("Profile.aspx?sucmsg=修改成功");
    }
}
